package com.guchenbo.example.encoding;

import java.io.UnsupportedEncodingException;

/**
 * @Author penglai
 * @Date 2016/10/26.
 */
public class UnicodeTest {
    public static void main(String[] args) throws UnsupportedEncodingException {
        char c = '多';
        System.out.println(Integer.toHexString(c));
        System.out.println(Integer.toBinaryString(c));

        System.out.println(Utf8Utils.utf84Unicode(c));
        System.out.println(Utf8Utils.utf84UnicodeHex(c));

        System.out.println(Utf16Utils.encode(c));
        System.out.println(Utf16Utils.encodeHex(c));

        String s = "多";
        System.out.println(s.getBytes("UTF-8").length);
        System.out.println(s.getBytes("UTF-16").length);

    }
}
